package cn.wit.baoyan.service.impl;


import cn.wit.baoyan.condition.BaoyanHistoryInfoCondition;
import cn.wit.baoyan.mapper.BaoyanHistoryInfoMapper;
import cn.wit.utils.pojo.BaoyanHistoryInfo;
import cn.wit.utils.pojo.BaoyanInfoDataAnalyze;
import cn.wit.baoyan.service.BaoyanHistoryInfoService;
import cn.wit.utils.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class BaoyanHistoryInfoServiceImpl implements BaoyanHistoryInfoService {
    @Autowired
    private BaoyanHistoryInfoMapper baoyanHistoryInfoMapper;


    @Override
    public Result getBaoyanHistoryInfo() {
        List<BaoyanInfoDataAnalyze> baoyanHistoryInfo = baoyanHistoryInfoMapper.getBaoyanHistoryInfo();
        if (CollectionUtils.isEmpty(baoyanHistoryInfo)) {
            return Result.ok(new ArrayList<>());
        }
        return Result.ok(baoyanHistoryInfo);
    }
}
